<?php 
require_once($_SERVER['DOCUMENT_ROOT']."/model/data_service.php");
require_once($_SERVER['DOCUMENT_ROOT']."/model/helper.php");
    if (isset($_POST) && array_key_exists("location_hotel_name",$_POST) && array_key_exists("category_filter",$_POST))
    {
        
        $map_id=MAP_ID;
        $map_key=MAP_KEY;
        $request_location = $_POST["location_hotel_name"];
        $data = explode(",",$request_location,3);
        $continent=$country=$city=NULL;
        count($data) ==2?list($continent,$country) = $data:FALSE;
        count($data) ==3?list($continent,$country,$city) = $data:FALSE;
        $cate = new Categories($_POST["category_filter"]);
        $categories_data = category_selection($cate,!empty($continent)?$continent:NULL,!empty($country)?$country:NULL,!empty($city)?$city:NULL,1,[]);
        //echo json_encode($categories_data);
        require_once($_SERVER['DOCUMENT_ROOT']."/view/map.php.html");
    } 
        ?>